<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
	<head>
		<title>重置密码</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		 <meta http-equiv="pragma" content="no-cache">
 		<meta http-equiv="cache-control" content="no-cache">
 		<meta http-equiv="expires" content="0">    
	<LINK href="<%=request.getContextPath()%>/css/cssCn.css" type="text/css" rel="stylesheet">
	<%@ include file="/comm.jsp"%>
<script>
	function resetUserPwd(){
		//校验密码长度、二次输入密码是否相等
		var userId=$d("hdfUserId").value;
		var passwordVal=$d("password1").value;
		var params = {
					userIdVal:userId,
					newPassword:passwordVal
					};
		$.ajax({type: "POST",
		       url: "ajaxUser_resetUserPwd",
		       data: params,
		       async: false,
		       success: function(responseMsg){
		         var result=eval('('+responseMsg+')');
				 if(result.retcode=="0000"){
				  	put_div.style.display="none";
				  	suc_div.style.display="block";
				 }else{
				  	errSpan.innerHTML=result.retmsg;
				 }
			  }
			},"json");
	}
</script>
</head>
	<body leftmargin="0" topmargin="0" marginheight="0">
		<s:form name="formpage" action="" namespace="/seal">
			<s:token>
			</s:token>
			<%@ include file="/messages.jsp"%>
			<s:hidden id="hdfUserId" value="%{#request.userInfo.userId}" />
			<div id="put_div">
			<table align="center" width="400">
				<tr>
					<td colspan="2"><span id="errSpan"></span></td>
				</tr>
				<tr>
					<td nowrap="nowrap" align="right">
						账户代码：
					</td>
					<td>
						${userInfo.userId }
					</td>
				</tr>
				<tr>
					<td align="right">
						请输入新密码：
					</td>
					<td>
						<input name="password1" id="password1" type="password" size="20"
								maxlength="20" class="required" value="" title="*必填" />
					</td>
				</tr>
				<tr>
					<td align="right">
						请再次输入新密码：
					</td>
					<td>
						<input name="password2" id="password2" type="password" size="20"
								maxlength="20" class="required" value="" title="*必填" />
					</td>
				</tr>
				<tr>
						<td colspan="2" align="center">
							<input type="button" class="button" id="ok" name="ok"
								value=" 修改 " onclick="resetUserPwd();" />
						</td>
					</tr>
				</table>
			</div> <!-- end #pub_div -->

			<div id="suc_div" style="display: none;" align="center">
				<div>
					密码重置成功!
				</div>
			</div> <!-- end #suc_div -->
		</s:form>
	</body>
</html>
